<div class="merchant-wrapper">
	{foreach $dishes as $dish}
	<div class="food-info-list" id="dish{$dish['id']}">
		<div class="food-introduce">
			<img class="food-introduce-pic" src="{$base_url.base_url}application/views/templates/merchant/upload/{$mid}/dish/{$dish['id']}.png" alt="chicken"
				 onerror="this.src='{$base_url.base_url}application/views/templates/merchant/upload/default.png';this.onerror=null">
			<div class="food-introduce-info">
				<h3 class="food-introduce-name">{$dish['dname']}</h3>
				<p class="food-introduce-discount">限时{$dish['discount']*10}折，快来抢购</p>
				<p class="food-introduce-money">原价￥{$dish['price']}</p>
				<div class="food-introduce-cart">
					<button class="food-introduce-addcart" onclick="dish_add({$dish['id']}, {$mid})">加入购物车</button>
					<form class="food-introduce-form">
						<input type="hidden">
						<button class="add-food" type="button" onclick="dish_min({$dish['id']}, {$mid})">-</button>
						<input class="food-number" oninput="dish_change({$dish['id']}, {$mid}, this.value)">
						<button class="minus-food" type="button" onclick="dish_add({$dish['id']}, {$mid})">+</button>
					</form>
				</div>
			</div>
		</div>
	</div>
	{/foreach}
</div>


<div>
	<div class="cart">
		<div class="cart-header">
			<div class="cart-header-content">
				<div style="color: #333333; font-size: 14px">
					购物车<span id="emptyCart" style="cursor: pointer" onclick="cleanCart({$mid})">[清空]</span>
				</div>
				<div>
					<img src="{$base_url.base_url}application/views/templates/diner/assets/images/cart.svg" style="width: 30px;">
				</div>
			</div>
		</div>

		<div id="cart_basket"></div>

		<div class="wrapper">
			<div class="cart-info">
				<span class="cart-icon">
					<img src="{$base_url.base_url}application/views/templates/diner/assets/open-iconic/svg/cart.svg">
				</span>
			</div>
			<a href="{$base_url.base_url}diner/order/{$mid}" style="text-decoration:none">
				<div class="cart-status" >
					<p class="status-info">购物车是空的</p>
				</div>
			</a>
		</div>
	</div>

</div>
<script src="{$base_url.base_url}application/views/templates/diner/js/cart.js"></script>
<script src="{$base_url.base_url}application/views/templates/js/jquery.min.js"></script>
<script src="{$base_url.base_url}application/views/templates/js/popper.min.js"></script>
<script src="{$base_url.base_url}application/views/templates/js/bootstrap.min.js"></script>
<script>
	window.onload = function (){
		let order = JSON.parse(`{$order_info}`);
		loadCartFromSession(order, {$mid});
	};
</script>
</body>

</html>
